package top.zuli.package02.homework06;

public class Demo3 {
    public static void main(String[] args) {
        int[] arr = new int[]{9,2,5,6,1,7,3};
        for(int i=0;i<arr.length/2;i++) {
            int str = arr[i];
            arr[i] = arr[arr.length-i-1];
            arr[arr.length-i-1] = str;

        }
        System.out.print("反转值为：");
        for(int i=0;i<arr.length;i++) {
            System.out.print(" "+arr[i]);
        }
        System.out.println();
        for(int i=0;i<arr.length-1;i++){
            for(int j=0;j<arr.length-1-i;j++){
                if(arr[j]>arr[j+1]){
                    int t = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = t;
                }
            }
        }
        System.out.print("排序值为：");
        for(int i=0;i<arr.length;i++){
            System.out.print(" "+arr[i]);
        }
    }
}
